package com.chen;

import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.gateway.filter.GlobalFilter;
import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;

@EnableDubbo
@SpringBootApplication
public class OpenapiGatewayApplication {

    public static void main(String[] args) {
        SpringApplication.run(OpenapiGatewayApplication.class, args);
    }

    //gateway
//    @Bean
//    public RouteLocator customRouteLocator(RouteLocatorBuilder builder) {
//        return builder.routes()
//                .route("test", r -> r.path("/openapi8")
//                        .uri("https://yupi.icu"))
//                .build();
//
//    }
@Bean
    public GlobalFilter customFilter() {
        return new CustomGlobalFilter();
    }
}
